<% content_tag :div, :class => 'bigwrapper' do%>
	<%=h flash[:error]%>
	<% content_tag :div, :class => 'editheader' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_64.png', :class => 'hleft' %>
		<%= content_tag :span, "<span class='smallgray'>edit action item </span>" + @contact.first_entry.fname + " " + @contact.first_entry.lname, :class => 'hleft' %>
		<% content_tag :span, :class => 'editheadertext' do -%>
			<%= content_tag :strong, "Action item's current information:" -%>
			<%= content_tag :div, "<span class='smallgray'>Description </span>" + @contact.first_entry.note -%>
			<%= content_tag :div, "<span class='smallgray'>Relationship </span>" + @contact.first_entry.relationship.to_s -%>
			<%= content_tag :div, "<span class='smallgray'>Last modified by </span>" + @contact.first_entry.created_by.fname -%>
		<% end -%>
		<% content_tag :div, :class => 'container' do -%>
			<%= content_tag :span, "<strong>All notes added to this contact: </strong>" -%>
		    <% for entry in @contact_entries %>
				<% content_tag :div, :class => 'headertext' do -%>
		            <%= content_tag(:span, entry.created_at.strftime("%Y.%m.%d"), :class=>"smallgray") %>
					<%= content_tag(:span, entry.fname + " " + entry.lname) %>
					<%= content_tag(:span, "updated by " + entry.created_by.fname, :class => "smallgray") %>
					<%= content_tag(:div, entry.note) %>
				<% end -%>
		    <% end %>
			
		    	<% form_tag :action => 'edit' do -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Add a note (<span class='red'>*</span>)<br/>"%>
						<%= text_area(:contact_entry, :note, :size=>"46x5")%>
					<% end -%>
					<% content_tag :div, :class => '' do -%>
						<%= content_tag :img, nil, :src => '/images/icons/icons_69.png', :class => 'icon' -%>
				    	<%= link_to_function "<strong>Show more options</strong>", "$('showoptions').toggle()" -%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
			            <%= submit_tag 'Submit note' -%>
					<% end -%>
					<% content_tag :div, :id => 'showoptions' do %>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Status (<span class='red'>*</span>):"%>
			            <%= select(:contact_entry, :status, ["Opened","Closed"], :selected=>@contact.first_entry.status) %>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Relationship (<span class='red'>*</span>):"%>
			            <%= text_field(:contact_entry, :relationship, :value => @contact.first_entry.relationship)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "First name (<span class='red'>*</span>):"%>
			            <%= text_field(:contact_entry, :fname, :value=>@contact.first_entry.fname)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Last name (<span class='red'>*</span>):"%>
			            <%= text_field(:contact_entry, :lname, :value=>@contact.first_entry.lname)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Title (<span class='red'>*</span>):"%>
			            <%= text_field(:contact_entry, :title, :value=>@contact.first_entry.title)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
			            <%= submit_tag 'Commit changes' -%>
					<% end -%>
			    <% end %>
			
			<% end %>

			<%=  javascript_tag("$('showoptions').hide()") %>
		<% end -%>
	<% end -%>
<% end -%>